<!DOCTYPE html>
<html>
<head>
    <title>紫云仓库表</title>
    <#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.css">
    <script src="${request.contextPath}/statics/libs/bootstrap-table.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.extension.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/tree.table.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <#if shiro.hasPermission("material:erpstock:save")>
            <a class="btn btn-primary btn-sm" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
            </#if>
            <#if shiro.hasPermission("material:erpstock:update")>
            <a class="btn btn-primary btn-sm" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
            </#if>
            <#if shiro.hasPermission("material:erpstock:delete")>
            <a class="btn btn-primary btn-sm" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
            </#if>
            <a class="btn btn-default btn-sm"  @click="query"><i class="fa fa-search"></i>&nbsp;查询</a>
        </div>
        <table id="stockTable" data-mobile-responsive="true" data-click-to-select="true"></table>
    </div>

    <div v-show="!showList" class="panel panel-default" align="center">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal" v-model="erpStock">
            <div class="form-group">
                <div class="col-sm-2 control-label">仓库名称：</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" v-model="erpStock.stockName" placeholder="仓库名称"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">父级仓库：</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" style="cursor:pointer;" v-model="erpStock.parentName" @click="stockTree" readonly="readonly" placeholder="父级仓库"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">是否禁用：</div>
                <div class="col-sm-10">
                    <!--<input type="text" class="form-control" v-model="erpStock.status" placeholder="仓库状态:0启用,1禁用"/>-->
                    <el-switch v-model="erpStock.status" active-text="是" inactive-text="否"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">所属组织：</div>
                <div class="col-sm-10">
                    <!--<input type="text" class="form-control" v-model="erpStock.institution" placeholder="所属组织"/>-->
                    <select class="form-control input-sm" v-model="erpStock.institution">
                        <option v-for="item in e.selfMerchantList" :value="item.sellerId">{{item.sellerName}}</option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">仓库类型：</div>
                <div class="col-sm-10">
                    <select class="form-control input-sm" v-model="erpStock.type">
                        <option v-for="item in e.type" :value="item.value">{{item.label}}</option>
                    </select>
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-2 control-label">备注：</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control input-sm" v-model="erpStock.remark" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary btn-sm" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning btn-sm" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>

<!-- 选择仓库 -->
<div id="stockLayer" style="display: none;padding:10px;">
    <ul id="stockTree" class="ztree"></ul>
</div>

<script src="${request.contextPath}/statics/js/modules/material/erpstock.js?_${.now?long}"></script>
</body>
</html>